package string;
 //判断开头或结尾

public class StartsWithDemo {
    public static void main(String[] args) {
        String str="thinking in java";
        boolean starts=str.startsWith("think");//判断是否是以think开头
        System.out.println(starts);
        boolean ends=str.endsWith("java");//判断是否以java结尾
        System.out.println(ends);

    }
}
